import request from '@/utils/request'

// 查询碳交易列表
export function listTrade(query) {
  return request({
    url: '/ccer/trade/list',
    method: 'get',
    params: query
  })
}

// 查询碳交易详细
export function getTrade(id) {
  return request({
    url: '/ccer/trade/' + id,
    method: 'get'
  })
}

// 新增碳交易
export function addTrade(data) {
  return request({
    url: '/ccer/trade',
    method: 'post',
    data: data
  })
}

// 修改碳交易
export function updateTrade(data) {
  return request({
    url: '/ccer/trade',
    method: 'put',
    data: data
  })
}

// 删除碳交易
export function delTrade(id) {
  return request({
    url: '/ccer/trade/' + id,
    method: 'delete'
  })
}

// 导出碳交易
export function exportTrade(query) {
  return request({
    url: '/ccer/trade/export',
    method: 'get',
    params: query
  })
}

// 保存上传数据
export function changeData(data) {
  return request({
    url: '/ccer/trade/changeData',
    method: 'post',
    data: data
  })
}
